package com.serviceprovider.business.module.sp.transaction.model;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.admin.user.model.OldUser;
import com.serviceprovider.business.module.sp.transaction.valueobjects.TransactionDetailsVO;

public class Transaction {
    private TransactionStatus transactionStatus = new TransactionStatus();
    private Integer           amount;
    private Integer           batchId;
    private Integer           customLabel1Value;
    private Integer           customLabel2Value;
    private OldUser           customer;
    private Integer           customerBalance;
    private Integer           electronicFillingFee;
    private Integer           electronicPrepFee;
    private Integer           fedBankProductFee;
    private Integer           id;
    private Integer           payee1Amount;
    private Integer           payee2Amount;
    private Integer           payee3Amount;
    private Integer           payee4Amount;
    private Integer           selfFee;
    private Integer           serviceBureauFee;
    private Integer           serviceFee;
    private Integer           stateProductFee;
    private Integer           taxPrepFee;

    public Transaction() {}

    public Transaction(TransactionDetailsVO tr) {
        this.id                   = tr.getId();
        this.batchId              = (tr.getBatch() != null)
                                    ? tr.getBatch().getId()
                                    : null;
        this.serviceFee           = tr.getServiceFee();
        this.selfFee              = tr.getSelfFee();
        this.taxPrepFee           = tr.getTaxPrepFee();
        this.electronicPrepFee    = tr.getElectronicPrepFee();
        this.electronicFillingFee = tr.getElectronicFillingFee();
        this.serviceBureauFee     = tr.getServiceBureauFee();
        this.fedBankProductFee    = tr.getFedBankProductFee();
        this.stateProductFee      = tr.getStateProductFee();

//      this.customLabel1Value = tr.getCustomLabel1Value();
//      this.customLabel2Value = tr.getCustomLabel2Value();
        this.customerBalance = tr.getCustomerBalance();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public OldUser getCustomer() {
        return customer;
    }

    public void setCustomer(OldUser customer) {
        this.customer = customer;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getServiceFee() {
        return serviceFee;
    }

    public void setServiceFee(Integer serviceFee) {
        this.serviceFee = serviceFee;
    }

    public Integer getSelfFee() {
        return selfFee;
    }

    public void setSelfFee(Integer selfFee) {
        this.selfFee = selfFee;
    }

    public TransactionStatus getTransactionStatus() {
        return transactionStatus;
    }

    public void setTransactionStatus(TransactionStatus transactionStatus) {
        this.transactionStatus = transactionStatus;
    }

    public Integer getTaxPrepFee() {
        return taxPrepFee;
    }

    public void setTaxPrepFee(Integer taxPrepFee) {
        this.taxPrepFee = taxPrepFee;
    }

    public Integer getElectronicPrepFee() {
        return electronicPrepFee;
    }

    public void setElectronicPrepFee(Integer electronicPrepFee) {
        this.electronicPrepFee = electronicPrepFee;
    }

    public Integer getElectronicFillingFee() {
        return electronicFillingFee;
    }

    public void setElectronicFillingFee(Integer electronicFillingFee) {
        this.electronicFillingFee = electronicFillingFee;
    }

    public Integer getServiceBureauFee() {
        return serviceBureauFee;
    }

    public void setServiceBureauFee(Integer serviceBureauFee) {
        this.serviceBureauFee = serviceBureauFee;
    }

    public Integer getFedBankProductFee() {
        return fedBankProductFee;
    }

    public void setFedBankProductFee(Integer fedBankProductFee) {
        this.fedBankProductFee = fedBankProductFee;
    }

    public Integer getStateProductFee() {
        return stateProductFee;
    }

    public void setStateProductFee(Integer stateProductFee) {
        this.stateProductFee = stateProductFee;
    }

    public Integer getCustomLabel1Value() {
        return customLabel1Value;
    }

    public void setCustomLabel1Value(Integer customLabel1Value) {
        this.customLabel1Value = customLabel1Value;
    }

    public Integer getCustomLabel2Value() {
        return customLabel2Value;
    }

    public void setCustomLabel2Value(Integer customLabel2Value) {
        this.customLabel2Value = customLabel2Value;
    }

    public Integer getCustomerBalance() {
        return customerBalance;
    }

    public void setCustomerBalance(Integer customerBalance) {
        this.customerBalance = customerBalance;
    }

    public Integer getBatchId() {
        return batchId;
    }

    public void setBatchId(Integer batchId) {
        this.batchId = batchId;
    }

    public Integer getPayee1Amount() {
        return payee1Amount;
    }

    public void setPayee1Amount(Integer payee1Amount) {
        this.payee1Amount = payee1Amount;
    }

    public Integer getPayee2Amount() {
        return payee2Amount;
    }

    public void setPayee2Amount(Integer payee2Amount) {
        this.payee2Amount = payee2Amount;
    }

    public Integer getPayee3Amount() {
        return payee3Amount;
    }

    public void setPayee3Amount(Integer payee3mount) {
        this.payee3Amount = payee3mount;
    }

    public Integer getPayee4Amount() {
        return payee4Amount;
    }

    public void setPayee4Amount(Integer payee4Amount) {
        this.payee4Amount = payee4Amount;
    }

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof Transaction)) {
            return false;
        }

        Transaction b  = (Transaction) obj;
        boolean     eq = ((id == null) && (b.id == null)) || ((id != null) && id.equals(b.id));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return (id != null)
               ? id.hashCode()
               : 0;
    }
}



